home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / MYTEST2.CPP < prev    next >
C/C++ Source or Header  |  1995-09-20  |  3KB  |  140 lines

  1. // mytest2.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "mytest2.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "mytstdoc.h"
  9. #include "mytstvw.h"
  10.  
  11. #include "z4.h"
  12.  
  13. #ifdef _DEBUG
  14. #undef THIS_FILE
  15. static char BASED_CODE THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CMytestApp
  20.  
  21. BEGIN_MESSAGE_MAP(CMytestApp, CWinApp)
  22.     //{{AFX_MSG_MAP(CMytestApp)
  23.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  24.         // NOTE - the ClassWizard will add and remove mapping macros here.
  25.         //    DO NOT EDIT what you see in these blocks of generated code!
  26.     //}}AFX_MSG_MAP
  27.     // Standard file based document commands
  28.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  29.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  30. END_MESSAGE_MAP()
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CMytestApp construction
  34.  
  35. CMytestApp::CMytestApp()
  36. {
  37.     // TODO: add construction code here,
  38.     // Place all significant initialization in InitInstance
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // The one and only CMytestApp object
  43.  
  44. CMytestApp NEAR theApp;
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CMytestApp initialization
  48.  
  49. BOOL CMytestApp::InitInstance()
  50. {
  51.  
  52.         // Standard initialization
  53.     // If you are not using these features and wish to reduce the size
  54.     //  of your final executable, you should remove from the following
  55.     //  the specific initialization routines you do not need.
  56.  
  57.     SetDialogBkColor();        // Set dialog background color to gray
  58.     LoadStdProfileSettings();  // Load standard INI file options (including MRU) 
  59.  
  60.         // Register the application's document templates.  Document templates
  61.     //  serve as the connection between documents, frame windows and views.
  62.  
  63.     CSingleDocTemplate* pDocTemplate;
  64.     pDocTemplate = new CSingleDocTemplate(
  65.         IDR_MAINFRAME,
  66.         RUNTIME_CLASS(CMytestDoc),
  67.         RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  68.         RUNTIME_CLASS(CMytestView));
  69.     AddDocTemplate(pDocTemplate);
  70.  
  71.     // create a new (empty) document
  72.     OnFileNew();
  73.  
  74.     if (m_lpCmdLine[0] != '\0')
  75.     {
  76.         // TODO: add command line processing here
  77.     }
  78.  
  79.  
  80.     return TRUE;
  81. }
  82.  
  83.  
  84. BOOL CMytestApp::ExitInstance()
  85. {
  86.     Z4_INQ::Terminate();
  87.     return CWinApp::ExitInstance();
  88. }
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. // CAboutDlg dialog used for App About
  92.  
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96.     CAboutDlg();
  97.  
  98. // Dialog Data
  99.     //{{AFX_DATA(CAboutDlg)
  100.     enum { IDD = IDD_ABOUTBOX };
  101.     //}}AFX_DATA
  102.  
  103. // Implementation
  104. protected:
  105.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  106.     //{{AFX_MSG(CAboutDlg)
  107.         // No message handlers
  108.     //}}AFX_MSG
  109.     DECLARE_MESSAGE_MAP()
  110. };
  111.  
  112. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  113. {
  114.     //{{AFX_DATA_INIT(CAboutDlg)
  115.     //}}AFX_DATA_INIT
  116. }
  117.  
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120.     CDialog::DoDataExchange(pDX);
  121.     //{{AFX_DATA_MAP(CAboutDlg)
  122.     //}}AFX_DATA_MAP
  123. }
  124.  
  125. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  126.     //{{AFX_MSG_MAP(CAboutDlg)
  127.         // No message handlers
  128.     //}}AFX_MSG_MAP
  129. END_MESSAGE_MAP()
  130.  
  131. // App command to run the dialog
  132. void CMytestApp::OnAppAbout()
  133. {
  134.     CAboutDlg aboutDlg;
  135.     aboutDlg.DoModal();
  136. }
  137.  
  138. /////////////////////////////////////////////////////////////////////////////
  139. // CMytestApp commands
  140.